<template>
  <transition :enter-active-class="aniClass+ ' ' + enter"
              :leave-active-class="aniClass + ' ' + leave">
    <slot></slot>
  </transition>
</template>

<script>
export default {
  name: 'CTransition',
  props: {
    enter: {
      type: String,
      default: 'fadeIn'
    },
    leave: {
      type: String,
      default: 'fadeOut'
    },
    speed: {
      type: String,
      default: ''
    }

  },
  computed: {
    aniClass () {
      let arr = ['animated']
      if (this.speed) {
        arr.push(this.speed)
      }
      return arr.join(' ')
    }
  }
}
</script>

<style lang="stylus" scoped>
  @import '~assets/styles/animate.styl'
</style>
